package cn.yitun.chat.yitunserverimcore.general.main.biz.group.manager;

import cn.yitun.chat.yitunservercommonlib.dataentity.vo.group.GroupSettingVo;
import cn.yitun.chat.yitunservercommonlib.enums.groupChat.GroupInviteSettingTypeEnums;
import cn.yitun.chat.yitunservercommonlib.enums.groupChat.GroupJoinVerifySettingTypeEnums;
import cn.yitun.chat.yitunserverimbase.dao.group.GroupSettingDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 
 * Date 2019-01-20 13:37:17<br>
 * Description
 * 
 * @author yitun<br>
 * @version 1.1
 */
@Service
public class GroupJoinSettingManager {

	@Resource
	private GroupSettingDao groupJoinSettingDAO;

	public GroupSettingVo getByGroupId(Long groupId) {
		GroupSettingVo uhs = groupJoinSettingDAO.getVOByGroupId(groupId);
		if (null == uhs) {
			uhs = new GroupSettingVo();
			uhs.setGroupId(groupId);
			uhs.setJoinType(GroupJoinVerifySettingTypeEnums.VERIFY_TYPE_AUTH.getType());
			uhs.setInviteType(GroupInviteSettingTypeEnums.INVITE_TYPE_AUTH.getType());
		}
		return uhs;
	}
}
